<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" href="/static/css/bootstrap.css">
	<link rel="stylesheet" href="/static/css/login.css">
	<title>MYSQL同步登录</title>
</head>
<body class="simple-page">


<div class="simple-page-wrap">

	<div class="simple-page-logo ">
		<a>
			<span></span>
			<span>MYSQL同步登录</span>
		</a>
	</div><!-- logo -->
	
	<div class="simple-page-form" id="login-form">
		<!--<h4 class="form-title m-b-xl text-center">请输入用户名和密码</h4>-->
		<form action="#" method="">
			<div class="form-group">
				<input type="text" name="username" id="username" class="form-control" placeholder="请输入用户名" value="">
			</div>
		
			<div class="form-group">
				<input type="password" name="password" id="password" class="form-control" placeholder="请输入密码">
			</div>
		
			<div class="form-group m-b-xl">
			
				<input name="isRememberMe" value="isRememberMe" type="checkbox" id="keep_me_logged_in" style="height:auto;margin:0 0 0 10px;">
				<label for="keep_me_logged_in">保存登录状态</label>
			
			</div>
			
			<input type="button" class="btn btn-primary" onclick="doLogin()" value="登录">
		</form>
	</div>
	


</div>

<script src="/static/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
	function doLogin() {
		$.ajax({
			type:'post',
			url:'/doLogin',
			data:{'username':$('#username').val(),'password':$('#password').val(),'isRememberMe':$('#keep_me_logged_in').prop('checked')},
			success:function (res) {
				if (res.errorCode === '0'){
					self.location='/index.html';
				}else {
					alert(res.desc);
				}
			}
		})
	}
</script>

</body></html>